import Vue from 'vue'
import App from './App'
import router from './router'
import axios from 'axios'
import {
  Pagination,
  Dialog,
  Checkbox,
  CheckboxButton,
  CheckboxGroup,
  Button,
  ButtonGroup,
  Popover,
  Tabs,
  TabPane,
  Carousel,
  CarouselItem,
  Loading,
  Message,
  MessageBox,
  Notification
} from 'element-ui'
import VueVideoPlayer from './components/video-player'
import store from './store'

import 'element-ui/lib/theme-chalk/index.css'
import 'animate.css'
import 'video.js/dist/video-js.css'
import './components/video-player/custom-theme.css'

Vue.use(VueVideoPlayer)

Vue.config.productionTip = false

Vue.use(Pagination)
Vue.use(Dialog)
Vue.use(Checkbox)
Vue.use(CheckboxButton)
Vue.use(CheckboxGroup)
Vue.use(Button)
Vue.use(ButtonGroup)
Vue.use(Popover)
Vue.use(Tabs)
Vue.use(TabPane)
Vue.use(Carousel)
Vue.use(CarouselItem)
Vue.use(Loading.directive)
Vue.component(Message.name, Message)
Vue.component(MessageBox.name, MessageBox)

Vue.prototype.$http = axios
Vue.prototype.$loading = Loading.service
Vue.prototype.$msgbox = MessageBox
Vue.prototype.$alert = MessageBox.alert
Vue.prototype.$confirm = MessageBox.confirm
Vue.prototype.$prompt = MessageBox.prompt
Vue.prototype.$notify = Notification
Vue.prototype.$message = Message
Vue.prototype.$wsUrl = 'ws://60.28.24.227:8282'
Vue.prototype.openLoading = function (elem = '.loading-content') {
  const loading = this.$loading({
    lock: true,
    text: '拼命加载中...',
    // spinner: 'el-icon-loading',
    background: 'rgba(0, 0, 0, 0.03)',
    target: elem
  })
  return loading
}

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
